package cn.risebd.wepay.serializer;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;

import cn.risebd.wepay.model.enums.FeeType;

/**
 * 交易类型反序列化器 @author 喝咖啡的蚂蚁  Date: 27/11/15
 * 
 * @since 1.0.0
 */
public class FeeTypeDeserializer extends JsonDeserializer<FeeType> {

	@Override
	public FeeType deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
		return FeeType.from(jp.getValueAsString());
	}
}
